projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ba4666
)
Fix TypeError with datetime() on old python version
author
Tom Wilkie
<tom.wilkie@gmail.com>
Fri, 13 Apr 2007 15:02:41 +0000
(16:02 +0100)
committer
Tom Wilkie
<tom.wilkie@gmail.com>
Fri, 13 Apr 2007 15:02:41 +0000
(16:02 +0100)
signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
tools/python/xen/xend/XendAPI.py
patch
|
blob
|
history
diff --git
a/tools/python/xen/xend/XendAPI.py
b/tools/python/xen/xend/XendAPI.py
index 9b03ff9be26e0d7f7522c6546ed03b6f6f67691f..89f0265f8b28f90b09a3f09c629a4a2fb55f9566 100644
(file)
--- a/
tools/python/xen/xend/XendAPI.py
+++ b/
tools/python/xen/xend/XendAPI.py
@@
-96,7
+96,10
@@
def datetime(when = None):
@param when The time in question, given as seconds since the epoch, UTC.
May be None, in which case the current time is used.
"""
- return xmlrpclib.DateTime(time.gmtime(when))
+ if when is None:
+ return xmlrpclib.DateTime(time.gmtime())
+ else:
+ return xmlrpclib.DateTime(time.gmtime(when))
# ---------------------------------------------------